package utstat;

import java.io.IOException;

import utstat.listeners.BalanceListener;

public class UtStats {

    public static void main(String[] args) throws IOException {
        if (args.length == 0) {
            System.out.println("USAGE: UtStats <logfile> <password> <host> [port]\n" +
            		"e.g. UtStats /home/uta/.q3a/q3ut4/ut.log uta 192.168.20.38 27961\n" +
            		"password must be set on server: /rconpassword uta" +
            		"port 27960 used by default");
            System.exit(1);
        }
        String logfile = args[0];
        String ip = args[1];
        String password = args[2];
        String port = args.length==4?args[3]:"27960";
        Rcon.init(ip,port,password);
        UtParser p = new UtParser();
        // p.registerListener(new ConsoleListener());
      //  p.registerListener(new HeadShotListener());
     //  p.registerListener(new FlagEventListener()); 
       // p.registerListener(new BananaListener());
     //   p.registerListener(new LemmingListener()); 
       // p.registerListener(new RevengeListener());
      //  p.registerListener(new ExcellenceListener());
     //   p.registerListener(new TeamworkListener());
     //   p.registerListener(new GenocideListener()); 
    //    p.registerListener(new SpawncampListener());
        p.registerListener(new BalanceListener());
        p.parse(logfile);
    }

}
